import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

const Routes = [
  {
    path: "/",
    name: "index",
    component: () => import("./components/index/index.vue"),
    meta: {
      nav: true,
      title: "Harvest Gain",
    },
  },
  {
    path: "/charitableOrganizationDetail",
    name: "charitableOrganizationDetail",
    component: () =>
      import("./components/charitableOrganizationDetail/index.vue"),
    meta: {
      nav: true,
      title: "Details of charitable organizations",
    },
  },
  {
    path: "/womensWellness",
    name: "womensWellness",
    component: () => import("./components/womens-wellness/index.vue"),
    meta: {
      nav: true,
      title: "Women's Wellness Project",
    },
  },
  {
    path: "/blogList",
    name: "blogList",
    component: () => import("./components/blog-list/index.vue"),
    meta: {
      nav: true,
      title: "Blog List",
    },
  },
  {
    path: "/category",
    name: "category",
    component: () => import("./components/category/index.vue"),
    meta: {
      nav: true,
      title: "Product Category",
    },
  },
  {
    path: "/products",
    name: "products",
    component: () => import("./components/products/index.vue"),
    meta: {
      nav: true,
      title: "Product Details",
    },
  },
  {
    path: "/blogDetail",
    name: "blogDetail",
    component: () => import("./components/blog-detail/index.vue"),
    meta: {
      nav: true,
      title: "Blog Details",
    },
  },
  {
    path: "/aboutUs",
    name: "aboutUs",
    component: () => import("./components/aboutUs/index.vue"),
    meta: {
      nav: true,
      title: "Harvest Gain - Abount Us",
    },
  },
  {
    path: "/allProduct",
    name: "allProduct",
    component: () => import("./components/products/all-product.vue"),
    meta: {
      nav: true,
      title: "Harvest Gain - All Products",
    },
  },
  {
    path: "/download",
    name: "download",
    component: () => import("./components/download/index.vue"),
    meta: {
      nav: true,
      title: "download center",
    },
  },
];

const router = new Router({
  mode: "history",
  // base: '/',
  routes: Routes,
  scrollBehavior(to, from, savedPosition) {
    return { x: 0, y: 0 };
  },
});

export default router;
